Log file for CMunge
===================

------------------------------------------------------------------------
    Version 0.76 13:12:38 10/5/2006
------------------------------------------------------------------------
$Log: VersionLog,v $
Revision 1.65  2006/05/10 12:14:20  justin
Summary:
  Fix for carry-capable return on veneer being inverted on 32bit builds.
Detail:
  * Carry capable setting on return from the veneer was not returning
    the correct flags because the condition check was inverted. We now
    return the C flag properly in that case.
Admin:
  Manual examination of code only; will test with the few modules
  that use it later. Fault reported by Matt Edgar.
Tag:
  CMunge-0_76

------------------------------------------------------------------------
    Version 0.75 13:05:15 10/5/2006
------------------------------------------------------------------------
Revision 1.64  2006/05/10 12:08:21  justin
Summary:
  Fix for broken handling of system by Pace SCL.
Detail:
  * The Pace SCL appears to have been modified to clear the command line
    set by DDEUtils if no DDEUtils command line is apparently required
    for the invocation of the subtask. This broke our explicit handling
    of the deficiency of the SCL with regard to long path names. After
    much discussion, the solution of replacing system with
    _kernel_system was reached and this has cured the problem.
Admin:
  Tested locally and by Alex Waugh and appears to have solved their
  problems. Fault originally reported by Alex, relayed through John
  Tytgat as part of the GCC development group.
Tag:
  CMunge-0_75

------------------------------------------------------------------------
    Version 0.74 20:02:31 22/3/2006
------------------------------------------------------------------------
Revision 1.63  2006/03/22 20:28:24  justin
Summary:
  Changed command-keyword-table processor to use a field table similar
    to the main keyword processor.
  Added support for empty command dispatch function.
  Updated documentation for handler: field in command table.
  Added support for no-handler: field to allow help-only commands.
  Added sanity checking to command table fields.
  Updated documentation to reflect the greater amount of testing.
  Updated blank file generation to take advantage of extra command table
    field help.
  Fix for typo in errors from main keyword processor.
Detail:
  * The command-keyword-table processor previously used a number of
    conditional checks for each explicit keyword chained together in
    if-else clauses. These seemed to be awkward to update, so a similar
    table to that used by the main processor has been created. This
    does not appear to have made the code either more readable or (on
    the face of things) more flexible. However, it does allow new
    fields to be added more readily, and this should be useful for the
    next batch of updates.
    As the address of the values being changed by each keyword is
    variable, we use a 'skeleton' help_list structure upon which the
    manipulated values are based. Pointer arithmetic is used to
    calculate the actual value within the current help_list element,
    and this should be checked carefully on other platforms. It is
    believed to be correct, but it may be more reliable to modify
    the code to use offsetof macros explicitly.
  * The C function supplied for commands may be left empty or specified
    as a '-' to indicate that no base function is to be used. This is
    only useful where all, or no, commands provide handlers.
  * The handler: field on the command-keyword-table was not documented,
    although it has been present for quite a few versions of the tool.
    It has now been added to the documentation and notes about its use
    are included.
  * The no-handler: field can be used to create help-only command
    entries. This sets the handler entry point to 0, and omits the
    veneer for that command. Loops within the writefile.c source have
    been updated to count the number of the entry point as this is now
    distinct from the command's position in the linked list. Similar
    changes have been added to the header generation.
  * The command-keyword-table values are now checked once the processing
    of the command has completed. This should ensure that the incorrect
    specification of some values does not have unintentional side
    effects (eg the max-args being set to 256). In particlar, we include
    a check for the use of the help: field as this is not implemented
    within the current version of CMunge and is unreliable in all known
    versions of CMHG.
  * The last version of CMunge (and preceeding versions) have undergone
    rigorous testing in both 26bit and 32bit environments, with hundreds
    of components in active use. No known problems have been seen since
    this time and it is believed that the last version is quite
    reliable within both 26bit and 32bit configurations. In addition,
    large numbers of modules have been constructed under cross-compiled
    environments (Linux and Windows) with no intermediate code
    generation (ARM assembler) problems. The documentation has been
    updated to reflect this higher degree of confidence in the tool.
  * The blank file output generation has been updated to use callback
    functions to augment the output from the main keyword processor
    table. This is used by the command-keyword-table entry to provide
    more information about the keywords which may be provided
    per-command. The resulting blank is larger because of this, but it
    is a benefit to have more information on these fields.
  * The main keyword processor would emit error messages stating
    'Tailing junk after ...'. This has been corrected to 'Trailing junk
    after ...'.
Admin:
  Tested with a few modules which use command-keyword-table entries. Not
  a rigorous test for this version, as more command-keyword-table
  changes will be following this checkin. However, tests against likely
  failure cases appear to show up as working correctly so far.
  Tests have been performed on Linux and RISC OS. No Windows testing.
  Most of the problems are likely to be parser-based rather than output
  based, so testing has focused on that.
Tag:
  CMunge-0_74

------------------------------------------------------------------------
    Version 0.73 03:31:57 20/2/2006
------------------------------------------------------------------------
Revision 1.62  2006/02/20 03:38:36  justin
Summary:
  Fix for 32bit vector-trap handlers, and carry-capable.
Detail:
  * The 32bit vector-trap handlers had not been checked for safety.
    These have now been checked by manual examination and were found to
    be inverted. The handler has now been corrected. Generic veneers
    in 32bit have also been modified to modify the PSR in force on
    entry, rather than the PSR on return from the client function.
  * Vector trap return code has been modified to correct a minor APCS-32
    violation. A failure could only occur if the vector-trap caller
    code was invoked from custom code. I do not believe the problem case
    could be generated by any extant version of the compiler.
  * Carry capable code has now been checked and similar code to that for
    the 26bit case has been used.
Admin:
  Tested build on RISC OS, generating both object through the assembler
  and source for manual examination. Both appear to be correct code.
  More tests may be needed to ensure that both the vector trap and the
  carry capable code are correct within 32bit builds.
Tag:
  CMunge-0_73

------------------------------------------------------------------------
    Version 0.72 22:33:26 13/1/2006
------------------------------------------------------------------------
Revision 1.61  2006/01/13 22:37:55  justin
Summary:
  Fix for C++ object initialisation within GCC.
Detail:
  * The GCC environment uses __gccmain to initialise its global objects
    within C++. This differs from the CFront ______main function's use
    only in name. When the GCC toolchain is in use we use the former
    name if C++ module initalisation is requested. If Norcroft is in
    use, we use the latter name.
Admin:
  Patch submitted by John Tytgat.
  This clearly precludes the use of CFront generated C code with GCC.
  This is not felt to be a significant issue - there would be greater
  interworking issues involved with such code than the initialisation
  of global objects.
  Not actually tested by me; I've examined the code and I'm trusting
  John because it's pretty obvious.
Tag:
  CMunge-0_72

------------------------------------------------------------------------
    Version 0.71 17:02:41 23/12/2005
------------------------------------------------------------------------
Revision 1.60  2005/12/23 17:15:53  justin
Summary:
  Changed use of VECTOR_CLAIM to VECTOR_ERROR for error-capable vector
    handlers.
  Fix for pre-processor error reports being oddly spaced.
  Minor change to command dispatcher.
  Minor change to date generation code.
Detail:
  * After consulting with John Tytgat, the VECTOR_CLAIM with parameter
    has been changed to VECTOR_ERROR. This removes my concerns about
    code requiring modification and is clearer as to the use. The world
    is a better place for it. We have tacked on the comment about
    VECTOR_ERROR in the note section of the prototype, which is just
    simpler than changing the exit string.
    The documentation has also been updated to reflect this.
  * Pre-processor errors would be printed with a trailing newline which
    meant that the error report had a blank line present. We now trim
    the newline if it is present which makes the error report more
    sensible.
  * The command dispatcher code we generated was using a signed
    comparison for the command number. To avoid the case where we are
    supplied a negative number causing either an infinite loop or a
    crash, we now use an unsigned comparison.
  * The date generation code was using sprintf to copy strings. We now
    use strcpy instead, where relevant. This should not affect the
    actual code because the form used by the user is checked and the
    strings generated by the strftime routine should not contain %
    characters. However, we cannot guarentee the later - in the same way
    that the user may be using a different locale and get 'Fev' instead
    of 'Feb', they may similarly get '%so' if the locale had a 3
    character abbreviation for the month name which was that. This could
    potentially cause us to abort. For now I'm (continueing) ignoring
    the issue of the locales because nobody as yet has reported a
    problem. It should be addressed at some point. The change will,
    however, prevent such spurious locales from causing us to abort.
  * Added a small note to the Makefile about building with StubsG rather
    than StubsGS, mostly for my own benefit until it is released.
Admin:
  Tested under RISC OS native builds. Header generation looks ok, but
  could do with updating to correctly place the VECTOR_ERROR case into
  the exit string. However, it should not confuse people. The command
  generation seemed to still work in tests. It is unlikely that a
  negative command number would be supplied, however, it is only a
  condition code change so it seems sensible.
Tag:
  CMunge-0_71

------------------------------------------------------------------------
    Version 0.70 19:55:30 17/12/2005
------------------------------------------------------------------------
Revision 1.59  2005/12/17 20:25:53  justin
Summary:
  Updated documentation to reflect obsolete nature of irq-handlers.
  Updated documentation with details of the error-capable vector-handlers.
  Updated documentation with short note about build switches.
  Updated documentation with note about command line compatibility with
    CMHG.
  Added support for error-capable to vector-handlers.
  Updated the blank values for swi-chunk-base-number and error-base to
    use safer values.
Detail:
  * The irq-handlers entry is obsolete, as declared in the old DDE
    manual, and we should not really be promoting its use by listing it
    before the vector-handlers entry that replaces it. The
    vector-handlers entry has consequently replaced that of the
    irq-handlers, and the irq-handlers entry has been marked as being
    obsolete. Additionally, the examples within that entry use the name
    'wrch' instead of 'irq1' as IRQ handlers are actually unlikely to
    be used by users.
  * Vector handlers (see below) are now documented in place of the old
    irq-handlers documentation (as described above). We give the
    parameter form in a similar way to that given in the generic-veneers
    entry.
  * A question about using CMunge to build 32bit modules was received a
    while back and this prompted the addition of a note about the
    building of modules for neutrality. In addition, I've suggested that
    automated builds use the -apcs switch as this is more broadly
    compatible than the redundant -26bit/-32bit switches.
  * Alongside the file format and header file compatibility, I've added
    some notes about the command line switch compatibility. This reads a
    little like a feature list, but it is intended to provide
    information necessary to interwork with both tools, should the CMHG
    tool ever gain features which are not supported by this tool.
  * The vector-handler entry point now accepts parameters. This is
    supported by the generalised 'read_handlers' function being updated
    to take a flags word instead of a single flag. The other handler
    functions now pass in the relevant flags so that values might be
    updated in the structure. Primarily this affects the 'read_generics'
    and 'read_vectors' which are the only handlers that support
    parameters at present.
    The code generated has changed for the handlers in some important
    ways. In particular, the entry number which is to be called used to
    be in r2 as a table offset. It is now in r9 as a table index (ie
    offset divided by 4), with a flag in bit 31. If the flag in bit 31
    is set, the entry is 'error-capable' and requires special handling
    on return. Notice that the use of bit 31 reduces the effective range
    of the values by 4; that is that if there are error-capable handlers
    present they must be within the first 64 handlers rather than the
    full 256 which are possible for regular handlers.
    It is the return which is the reason for the change to using R9 - it
    will be preserved by APCS calling conventions. If any 'error-capable'
    routines are used, an alternate return sequence is constructed which
    deals with the return. Because it is the PSR flags which being
    manipulated, the exit sequences are significantly different for the
    26bit and 32bit versions.
  * The swi-chunk-base-number and the error-base are now within sensible
    ranges. In addition, I have taken the values from the PRM which have
    been reserved and added these to the descriptions. This should help
    decide what numbers to use 'randomly' during development. Obviously
    developers won't bother to register values at the start of a
    project even though that is recommended, so we try to help out by
    giving them the ranges so that they know what is sensible.
Admin:
  Tested within new module for which the error-capable flag was required
  and appears to be functional. Manual examination of non-error-capable
  output appears to be correct, and building of modules which are
  non-error-capable appears unaffected by these changes.
  In looking at the code, one thing that is obvious is the duplication
  of the vector entries within the irq handler and vector handler code.
  It seems unnecessary; we could use a single variable. However, for now
  this rationalisation has been left.
Tag:
  CMunge-0_70

------------------------------------------------------------------------
    Version 0.69 15:24:53 1/11/2005
------------------------------------------------------------------------
Revision 1.58  2005/11/01 15:26:59  justin
Summary:
  Minor documentation fixes from John Tytgat.
Detail:
  * Typos and spelling mistakes for words which I regularly get wrong
    supplied by John Tytgat.
Admin:
  No actual code changes; just documentation.
Tag:
  CMunge-0_69

------------------------------------------------------------------------
    Version 0.68 19:04:09 31/7/2005
------------------------------------------------------------------------
Revision 1.57  2005/07/31 18:14:23  justin
Summary:
  Fix for potential unaligned instruction.
Detail:
  * Within the module header it was possible, with runnable modules
    without any other entry sequences, to generate a module with an
    instruction that is unaligned. Such a module would not be usable
    unless the simple-rma-app feature was used because such modules
    would be required to trap the memory service to prevent their slot
    being paged out (assuming they were tasks). However, this was not
    good. The code has been rearranged so that the sections which require
    alignment are always forced to be aligned.
Admin:
  Tested locally and seems to generate correct code now.
  Fault located and patch submitted by John Tytgat.
  There is a slight change in the behaviour now in that command tables
  will always be aligned. Previously we could have saved up to 4 bytes
  by having the command table run on from earlier strings. Given the
  other wastages in the header, this probably isn't a huge issue. It
  does break binary comparison with CMHG generated headers I believe (if
  it wasn't already broken).
Tag:
  CMunge-0_68

------------------------------------------------------------------------
    Version 0.67 15:38:35 23/7/2005
------------------------------------------------------------------------
Revision 1.56  2005/07/23 14:40:32  justin
Summary:
  Fix for aborts if SWI prefix was omitted.
Detail:
  * The code which dealt with a lack of a SWI-prefix (and thus a missing
    swi-decoding-table) failed to initialise the next pointer in the
    chain. This meant that when the SWI table was written to the module it
    would cause an abort when random data was dereferenced.
Admin:
  This seems to have been a quite old bug. Reported by John Tytgat.
Tag:
  CMunge-0_67

------------------------------------------------------------------------
    Version 0.66 05:26:22 23/7/2005
------------------------------------------------------------------------
Revision 1.55  2005/07/23 04:31:38  justin
Summary:
  Fix for failed filename conversion in filename_riscostounix.
Detail:
  * The filename_riscostounix function would not process extension lists
    correctly - it would enter an infinite loop rather than stepping
    through the list. The string is now stepped through correctly by
    moving the pointer to the end of the list.
Admin:
  This change has no impact on CMunge; it merely fixes the routine which
  was broken. The filename_riscostounix routine is only called for the
  linux Norcroft builds, and then without an extensions list. Because of
  this, the bug could never be triggered - it was only noticed when the
  file was used in a different component.
  Thus, this version is functionally identical to 0.65.
Tag:
  CMunge-0_66

------------------------------------------------------------------------
    Version 0.65 01:07:40 22/7/2005
------------------------------------------------------------------------
Revision 1.54  2005/07/22 00:15:28  justin
Summary:
  Corrected filename extension list definitions for UnixLib and GCC.
  Large scale tests completed safely.
Detail:
  * The comments provided for (and values of) the GNU GCC tool were
    incorrect. The definition has now been corrected to reflect the
    description given by John Tytgat for UnixLib's default, and a new
    definition added for the default extension list used by the GCC
    resource.
  * The updated tool has now been tested with the Norcroft toolchain
    on RISC OS and linux and appears to function correctly. The issues
    that were observed were restricted to the differing behaviour due
    to the change of the pre-processor behaviour in -p over -px; these
    are local issues as I am probably the only author to use this
    feature. Module builds and their subsequent operation on being loaded
    performed as previously with no noticeable difference.
Admin:
  Corrections provided by John Tytgat. Doesn't affect the tool at all.
  Testing is, I feel, adequate now to say the changed GCC support features
  have not affected the underlying functionality. Mostly this extra
  testing has been performed to try to ensure that the version to be
  committed to the GCC CVS repository is known stable and should therefore
  not require extensive exchanges of compatibility sources - we can
  therefore concentrate (at some point) on functional enhancements.
  Thus, this checkin does not contain a large change-set, but does form
  a place-holder for a known working version of the tool.
Tag:
  CMunge-0_65

------------------------------------------------------------------------
    Version 0.64 03:02:20 21/7/2005
------------------------------------------------------------------------
Revision 1.53  2005/07/21 02:11:45  justin
Summary:
  GCC toolchain fix for invalid throwback error.
Detail:
  * The GCC toolchain warnings had been incorrectly merged from John
    Tytgat's changes and a -throwback option would generate an error
    because it fell through to the Norcroft case. We now break there.
  * The filename code had a redundant static buffer, now removed.
Admin:
  Checked changes here and look ok - the changes should not affect the
  Norcroft toolchain that I can test so there's no point in testing
  further. A fuller test will follow with more modules.
  Faults pointed out by John Tytgat.
Tag:
  CMunge-0_64

------------------------------------------------------------------------
    Version 0.63 04:33:29 20/7/2005
------------------------------------------------------------------------
Revision 1.52  2005/07/20 03:42:50  justin
Summary:
  This version deals with GCC and general CMHG compatibility fixes.
  GCC front end is now invoked rather than the sub-tools.
  Unix-style naming convention now supported, in line with CMHG.
  Corrected -help output with apcs selection switches.
  Clearer error messages from non-source file input (no longer reports
    last line).
Detail:
  * c.assemble, c.readfile (gcc toolchain): We're using gcc (as frontend
    binary) to (optionally) pre-processs and assemble instead of directly
    calling the underlying 'cpp' and 'as' binaries.  This has as advantage
    that we don't need hacks to locate correct cpp/as binaries
    (hack = no need to specify the binary directory of cpp/as during CMunge
    compilation).
    Normally gcc is found in the current run path but on non-RISC OS
    platforms this might result in using a non ARM gcc toolchain.
    Therefore if GCC_BIN_DIR is defined during CMunge compilation, we will
    use that as the directory to find the gcc frontend binary.
  * c.assemble: disable throwback if running on non-RISC OS platform.
  * c.blank.c, c.gfile, c.options, c.readfile: in order to support
    transparently the use of unix-style filenames in line with that of
    CMHG, we first try to open the file using the given filename and if that
    fails, we assume the filename was "source.c"-style and try the
    "c.source"-style instead. The conversion code is on c.filename and is
    believed to be correct. The extension-set used is equivalent to that
    of CMHG.
  * c.filename: provides the translation between RISC OS and Unix naming
    conventions, with extension swapping where appropriate.
  * c.gfile, h.gfile:
    - constified the 'filename' parameter of file_find(), file_write(),
      file_read() to indicate that these functions don't change the
      contents of the 'filename' string.
    - file_getfilename() : new function which gives the 'filename' back
      for the given FILE file handle.  This is used to figure out the
      real filename of the file opened with file_read()/file_write()
      because those functions can try variations on their given
      filenames because of suffix swapping.  If needed, in the future
      this might also return a fully canonicalised filename.
  * c.main (main): comma was missing the changes printed by the format_wrap()
    calls (code which is normally disabled by '#if 0').
  * c.options, h.options (Options_CL): processing of the "-h"/"-help" cmd
    line option is delayed (via the opt.help_requested variable) until all
    options are processed.  This allows the user to see what the apcs
    selection is in the produced help text output when apcs and "-h"/"-help"
    are mixed *irrespectively* of the order of those options (i.e. before
    this fix "cmunge -32bit -h" gave a different output as "cmunge -h
    -32bit").
    Changed the fixed values as 3rd parameter of strncmp() to sizeof()-1
    equivalents like done in other parts of the code.
  * c.readfile (preprocess): the error line number when "Unknown preprocessor
    command encountered" error was given, was one line number wrong.
  * c.options (gcc,lcc toolchain): output warning when the -throwback
    and -depend options don't have any effect due to not being supported
    (either by running on non-RISC OS platforms, either the support hasn't
    been coded).
  * c.readfile: reset opt.atline to zero after completely parsing the
    (pre-processed) cmhg file so that errors/warnings from then on no longer
    refer to the last line of the (pre-processed) cmhg file as source of
    the error/warning.  A source of such an error could e.g. be the failure
    to open the CMunge header file.
  * c.system: check DDEUtils_SetCLSize and DDEUtils_SetCL before defining
    them themselves as these #defines might be defined in kernel.h.
    Either now (e.g. in the GCCSDK SCL stub headers today), or in the
    future (e.g. in a new release of the Norcroft compiler).
  * c.throwback: the RISC OS specific throwback code was only enabled
    when __riscos is defined and when CROSS_COMPILE is not defined.
    This has been reduced to just the __riscos check.
  * c.apcscli: compiler warnings and over-cautious code removed. Part
    of the minimal-abbreviation parser was being over-cautious about
    its arguments and used what appeared to be some ambiguous comparisons.
    The code has been reduced to a more readable and correct version.
Admin:
  The bulk of these changes are based on source provided by John Tytgat,
  most of which was integrated wholesale. Where changes have been made,
  they are most likely my own mistakes.
  The new [ch].filename sources provide the suffix swapping on filenames
  which appears to function correctly in tests. It has not been exercised
  much, it may contain faults.
  Linux build not tested with the Norcroft tools.
  Linux build not tested with the GCC tools.
  RISC OS build tested with regular command line operations and with
  the suffix swapped filenames (a feature pointed out to me by JT) and
  appears to be correct.
  Because of the scope of these changes, this is expected to be an
  intermediate checkin, with another one to follow with bug fixes after
  JT has looked over these changes and pointed out things that I've
  missed or done wrongly.
Tag:
  CMunge-0_63

------------------------------------------------------------------------
    Version 0.62 23:36:27 19/7/2005
------------------------------------------------------------------------
Revision 1.51  2005/07/19 22:44:02  justin
Summary:
  Added 'extended' pre-processor (-px) processing.
  APCS 'reentrant' flag is now faulted by the processor.
Detail:
  * CMunge and CMHG behaviour were differing in their management of the
    pre-processed files. CMHG will only process text from the first file
    it is given; any text in included files will be ignored. CMunge was
    processing all of the text. This change makes CMunge's default
    operation match that of CMHG. To obtain the old-CMunge behaviour -
    that of processing all text in included files - the -px switch should
    be used.
  * APCS 'reentrant' might be supported at a later date, and to ensure
    that we are fault this if passed to a CMunge that does not support it,
    we now cause an error if this is supplied.
Admin:
  Tested with example files supplied by John Tytgat.
  Differences in CMHG and CMunge pre-processing reported and diagnosed by
  John Tytgat.
  It appears that carry-capable returns are still not supported in 32bit
  builds. This has now been noted in the source code. Filing systems are
  thus not supported with CMunge in 32bit builds yet.
Tag:
  CMunge-0_62

------------------------------------------------------------------------
    Version 0.61 01:56:18 16/7/2005
------------------------------------------------------------------------
Revision 1.50  2005/07/16 00:59:52  justin
Summary:
  Fix for mis-written C header containing garbage characters.
  Correction for Justin's email address.
Detail:
  * The formatting routine had been incorrectly optimised and was not
    stopping at the 0-terminated end of the strings. The lack of comments
    on the code meant that the change had an unforeseen consequence. The
    optimisation has been reverted and comments added to describe the
    reason.
  * The email address has been incorrect for some time without my
    noticing. Hopefully not too much mail has been incorrectly addressed.
Admin:
  Tested locally with example header and no longer outputs garbage
  characters at the ends of lines.
  Reported by John Tytgat.
Tag:
  CMunge-0_61

------------------------------------------------------------------------
    Version 0.60 01:25:43 10/7/2005
------------------------------------------------------------------------
Revision 1.49  2005/07/10 00:33:53  justin
Summary:
  Improved GCC support for modern toolchain.
Detail:
  * Changes to the invocation of the AS tool in order to build correctly
    in different environments. I have not investigated this and presume
    it to be correct, however I do believe that this is not quite a
    sufficient merge to make it useful under non-RISC OS builds. Norcroft
    operation is unchanged.
  * Datestamp routines are now reduced to the standard C formatting
    functions. The previous _kernel_swi calls for RISC OS, and standard
    C functions under linux seems to be redundant. We now only use the
    standard C functions.
  * Some text strings have been tidied up where messages were untidy,
    incorrect or unclear.
  * All uses of strdup have been replaced by strdup_strip which should
    alleviate confusion over its operation.
Admin:
  Patches submitted by John Tytgat on behalf of GCC development team.
Tag:
  CMunge-0_60

------------------------------------------------------------------------
    Version 0.59 21:38:17 26/9/2004
------------------------------------------------------------------------
Revision 1.48  2004/09/26 20:41:52  justin
Summary:
  Fix for headers providing SWI chunk but not names causing segmentation
    faults.
Detail:
  * Because the SWI chunks was being used but the name was unallocated,
    the tool would abort when the such files were used. This caused
    problems when building the EtherY module. We now report a warning
    when this is done so that the user is aware that an assumption has
    been made.
Admin:
  Tested with EtherY build and now appears to work. Really such headers
  should have their names given, but for compatibility we keep the header
  valid like that. The EtherY module also appears to use # as a comment
  character which isn't something that I've seen before. I've not added
  that as a feature of CMunge yet; it might need to be if this is actually
  the defined operation of CMunge.
Tag:
  CMunge-0_59

------------------------------------------------------------------------
    Version 0.58 17:20:07 16/9/2004
------------------------------------------------------------------------
Revision 1.47  2004/09/16 16:27:49  justin
Summary:
  Updated simple RMA application to be 32bit safe.
  Updated Vector Trap handler to be 32bit safe.
Detail:
  * The simple RMA application entry sequence was actually just about
    correct; it was only the exit sequence that needed a slight update.
  * With a little bit of munging we now have a 32bit safe vector trap
    routine which should allow us to build the final set of modules that
    we hadn't otherwise been able to build. I believe the only people that
    are using vector traps are Simtec, so this isn't a huge change, but
    they did request it a long time ago. One thing to note about the
    vector traps, that I hadn't noticed when I wrote it originally, is
    that for the trap callback they do not revert to the callers mode.
    This probably isn't a problem as none of the APIs require that they
    be called in IRQ mode; Some events are entered in IRQ mode but that
    doesn't mean they would stay in IRQ mode and if called from
    OS_CallAVector they would be entered in SVC mode. Either way IRQ
    semantics are still in place, so I don't think it makes much odds.
Admin:
  Tested on RO5 and appears to work correctly with ClipboardHolder. Tests
  on RO4 32bit with older modules imply that everything is well so far
  for 32bit safety, but the vector trap handler has not been tested more
  than by examination.
Tag:
  CMunge-0_58

------------------------------------------------------------------------
    Version 0.57 15:16:11 16/3/2004
------------------------------------------------------------------------
Revision 1.46  2004/03/16 15:21:01  justin
Summary:
  Changed RISC OS invocation of system commands to always set DDE command line.
  Fix for 'equivilent' typo.
Detail:
  * Because of problems with the path length might cause it to be
    impossible to invoke the pre-processor (for example) due to the
    command length limits, we now put the entire command line into
    DDEUtils extended command line. The problem is worse on RISC OS 3.7
    and earlier which have 256 character CLI buffers. SCL uses a limit
    of 256 characters to decide whether to expand to the extended command
    line. On later systems the longer CLI means that the expansion of a
    command shorter than 256 characters is likely to be safe (it should
    still expand to be less than 1024 characters), but this isn't the case
    on 3.7. Because we know that the tools we invoke will all support the
    extended command line we can safely invoke them in this manner.
  * I've been spelling 'equivalent' wrongly for a while.
Admin:
  Tested build locally. Both faults reported by Chris Bazley.
Tag:
  CMunge-0_57

------------------------------------------------------------------------
    Version 0.56 01:53:39 1/1/2004
------------------------------------------------------------------------
Revision 1.45  2004/01/01 02:13:24  justin
Summary:
  Fix for dependency information writing correct object filename.
Detail:
  * When pre-processing files, we would generate !Depend information. This
    would be created by the pre-processor. However, the 'object' file for
    the data would not be set on the command line, so the pre-processor
    would guess that this was an o. file. This is incorrect for my build
    environment where modules are built into oz, and 32 bit code into o32
    or oz32 directories; similarly (and more importantly) it means that
    header generation now creates correct dependency information.
Admin:
  Tested with component seen to be failing and appears to generate the
  correct dependencies for both headers and object files.
Tag:
  CMunge-0_56

------------------------------------------------------------------------
    Version 0.55 09:18:26 29/12/2003
------------------------------------------------------------------------
Revision 1.44  2003/12/29 09:23:45  justin
Summary:
  Updated sources to build under linux more reliably.
  Abstracted out APCS CLI parsing routines.
Detail:
  * Although building under linux is less useful to many, it makes testing
    of the core code a lot faster and this makes the development a lot
    faster. The changes are not too wideranging - escaping of the
    assembler and pre-processor command lines (because of system variable
    usage, etc), and corrected use of isalpha rather than isascii.
  * I'm going to use the APCS command line parser in a few other tools
    and rather than re-write all the code again, I've abstracted the
    entire parser out of the options.[ch] files into apcscli.[ch]. This
    should allow me to use it elsewhere without any significant changes.
    Eventually it will find its way into a library, but for now this is
    reasonable.
Admin:
  Tested locally with the example CMunge files and appears to work
  correctly. Will need more testing with 'live' CMHG files.
Tag:
  CMunge-0_55

------------------------------------------------------------------------
    Version 0.54 05:11:38 29/11/2003
------------------------------------------------------------------------
Revision 1.43  2003/11/29 05:18:41  justin
Summary:
  Updated build and source to work under linux.
  Improved data-string checks to prevent invalid date strings.
Detail:
  * The source code has been updated to omit unnecessary RISC OS
    dependence. This means removing the calls to read the date using
    OS_Word, redundant inclusion of kernel.h and a minor change to the
    pre-processing call. Use the 'mklinks' script to build CMunge under
    linux. It is expected that a suitable toolchain be present for this
    to function as expected.
  * It was possible to get an invalid date string attached to the module
    through an erroneous specification of date-string. We now check that
    the string has the right shape and fault it if not. This also removes
    the potential for trailing text on the date-string. Note that we don't
    check that the actual content of the date-string is correct. Dates
    such as "99 XXX 9999" can be specified - this might be improved in
    the future.
Admin:
  Tested under linux and appears to generate the correct files. For
  correct operation under linux it is required that the pre-processor be
  invoked. No other operation has been tested.
  If RISC OS name conventions are used it will be necessary to ensure that
  the pre-processor and/or assembler are capable of accepting such
  conventions. Further modification may be necessary in the future to
  more explicitly support other toolchains without RISC OS naming
  conventions.
Tag:
  CMunge-0_54

------------------------------------------------------------------------
    Version 0.53 01:15:11 18/10/2003
------------------------------------------------------------------------
Revision 1.42  2003/10/18 00:17:58  justin
Summary:
  Fix for 32bit incompatible service entry sequence.
Detail:
  * The entry sequence generated in 32bit mode where the fast reject
    service numbers were larger than could be represented in an
    instruction would always be loaded using 26bit flag-restoring which
    was wrong.
Admin:
  Tested locally with simple modules and appears to provide the correct
  entry sequence.
Tag:
  CMunge-0_53

------------------------------------------------------------------------
    Version 0.52 21:01:58 6/10/2003
------------------------------------------------------------------------
Revision 1.41  2003/10/06 21:12:01  justin
Summary:
  Added explicit support for C++ modules.
Detail:
  * Although it has always been possible to create modules that use C++
    code sections, it required that the modules themselves call the
    global constructor routine ______main. I've added a minor change to
    the initialisation sequence which will do this call for you.
Admin:
  Tested with C++ and normal C module and appears to work correctly.
Tag:
  CMunge-0_52

------------------------------------------------------------------------
    Version 0.51 18:32:33 6/10/2003
------------------------------------------------------------------------
Revision 1.40  2003/10/06 17:35:04  justin
Summary:
  Removed an unmatched apostrophe from the blank header.
Detail:
  * I was getting fed up with having to remove this apostrophe on all my
    'blank'-based headers because the Norcroft compiler in pre-processor
    mode dislikes it. So I've removed the apostrophe. The sentence still
    makes sense, it's just not as correct English as it was.
Admin:
  Only a generated header change, no significant code modified. Tested
  with test suite and didn't affect anything.
Tag:
  CMunge-0_51

------------------------------------------------------------------------
    Version 0.50 03:27:31 29/9/2003
------------------------------------------------------------------------
Revision 1.39  2003/09/29 02:30:07  justin
Summary:
  Added support for simple additive integers.
Detail:
  * Integer values (decoded by 'strint') can now be accumulated with
    simple additive arithmetic operations. This fits in with the
    bracketing regime we already enforce and allows values to be
    accumulated without a separate processing phase (or any additional
    work on the headers prior to export).
Admin:
  Tested operation with example file modified appropriately
  (examples.cmhg.module) and with the new STV680 module which provoked
  the issue. Both now work and I can now use exported headers based at
  set values.
Tag:
  CMunge-0_50

------------------------------------------------------------------------
    Version 0.49 03:27:39 17/8/2003
------------------------------------------------------------------------
Revision 1.38  2003/08/17 02:36:28  justin
Summary:
  Fix for handling of the event handlers.
  Added warnings about use of event-handlers when in cmhg mode.
  Added warnings for -apcs and -t when in cmhg mode.
Detail:
  * Multiple event vectors were not actually being handled correctly.
    Both the entry and the dispatch veneers were being constructed
    incorrectly, resulting in vectors being dispatched to the wrong
    handlers. Consequently modules using multiple event handlers would
    (usually) cause the machine to stiff as vectors were processed by
    the wrong routines. We now dispatch to the correct handlers and in
    the entry sequence we correctly branch to the dispatch routine for
    the events handlers which are not the last in the list.
  * It seems that I was overly optimistic in my belief that CMHG could
    handle multiple event handlers. Although CMHG appears to accept
    multiple event handlers, it will only generate code to dispatch the
    last of these. We now generate a warning if cmhg mode is in use and
    multiple handlers are specified, and we discard the earlier handler
    to match CMHG. This has been added to the documentation of the
    event-handler entry points.
  * If the explicit APCS specification, or the toolchain option are
    given, and cmhg mode has been specified, we now emit a warning to
    remind users that these are CMunge only features. We continue on,
    though.
Admin:
  Tested locally with module using multiple event handler entry points
  and no longer causes the machine to lock solid when data arrives on
  a socket. The events are now being dispatched properly to the two
  event handlers and the module functions as it did with CMHG (albeit
  with two event handlers, rather than only 1).
Tag:
  CMunge-0_49

------------------------------------------------------------------------
    Version 0.48 00:36:38 16/8/2003
------------------------------------------------------------------------
Revision 1.37  2003/08/15 23:44:07  justin
Summary:
  Added support for explicit specification of APCS variant.
Detail:
  * In order to provide a common command line with the compiler and
    assembler tools, the -apcs option has been added. This should allow
    makefiles to specify the same options to all the tools which should
    simplify makefile construction.
  * This change has introduced a new 'apcs' flags option, rather
    than the old 'bitness' binary flag. This has meant quite a few changes
    across the source. Where the bitness was tested previously, the macros
    CODE26 or CODE32 are used instead.
  * The majority of the APCS variants are disallowed at present and raise
    a fatal error if selected.
  * In the -help output we display the names of the -apcs flags and their
    descriptions. This is partly as a reminder for CMunge, but also it
    is useful when the options for the compiler have been forgotten as
    the options are equivalent. If a -apcs option is specified with the
    -help option this will update the flags to the newly selected APCS
    variant. This may be useful for debugging.
Admin:
  Tested locally and appears to fault the correct variants, generate the
  correct code and supply the right arguments to objasm.
  The operation with as has not been addressed. It's like that the flags
  specified to as may not match those required by the user. This should
  be looked at by someone who uses as.
Tag:
  CMunge-0_48

------------------------------------------------------------------------
    Version 0.47 01:12:14 15/8/2003
------------------------------------------------------------------------
Revision 1.36  2003/08/15 00:14:17  justin
Summary:
  Added initial support (useless) for LCC toolchain.
Detail:
  * The initial work has been done to make the LCC toolchain usable with
    CMunge. However, because of failings in the cpp tool that comes with
    LCC it is not possible to use the LCC toolchain with CMunge at the
    present time. That's even allowing for the lack of any module
    generation code in LCC.
Admin:
  Tested locally and found to be pretty much useless for use with LCC.
  Other toolchains appear unaffected by these changes.
Tag:
  CMunge-0_47

------------------------------------------------------------------------
    Version 0.46 21:32:41 14/8/2003
------------------------------------------------------------------------
Revision 1.35  2003/08/14 21:03:14  justin
Summary:
  Added support for GCC toolchain.
Detail:
  * The code can now use gcc toolchain (as/cpp) rather than the Norcroft
    toolchain (objasm/cc). This has required a little bit of testing and
    it should work correctly for most environments. However, in order to
    accomodate as's more limited evaluation, I've removed one of the
    immediate value calculations. This could probably be addressed better
    for as, but for simplicity I've reduced that. AS was complaining about
    the use of local labels in the assembler as well, so I've reduced
    those to literal symbols instead.
Admin:
  Tested locally with a contemporary gcc installation and it appears to
  build output correctly.
Tag:
  CMunge-0_46

------------------------------------------------------------------------
    Version 0.45 19:28:56 14/8/2003
------------------------------------------------------------------------
Revision 1.34  2003/08/14 18:47:08  justin
Summary:
  Added support for multiple event-handler entries.
Detail:
  * Previously, we only supported a single event-handler and had a single
    table of values that would be accepted. I've moved the table of values
    into the handler_list entries and made the event-handler processing
    routine capable of multiple entries. When writing out the entries, the
    we iterate over the handler list.
Admin:
  Tested with example code in Examples.cmhg.module to which I've added
  a couple of handlers and it appears to work just fine with those.
  Non-event-handler modules also seem the same as before.
Tag:
  CMunge-0_45

------------------------------------------------------------------------
    Version 0.44 15:56:20 17/7/2003
------------------------------------------------------------------------
Revision 1.33  2003/07/17 15:04:26  justin
Summary:
  Changed use of strncasecmp to stricmp.
  Fix for uninitialised variable in the service call sorting.
Detail:
  * strncasecmp was a function we provided which compared strings case
    insensitively. This is defined in some unix-like libraries to have
    a different prototype (and function). To make the library a little
    easier to port, it has been renamed to stricmp and the associated
    code changed to reflect this.
  * When the service call list was being sorted, the entries were being
    generated incorrectly because 'min' was never initialised to 0
    before the list was generated. This could result in some entries not
    being listed.
Admin:
  Tested very briefly here and it seems to work correctly, but I think
  I was just very lucky that I never saw problems with the fast service
  entry before. Probably it would be better if we just called qsort on
  the list before we used it, rather than doing the sort for one part
  and then ignoring the sorting for the second (code) part.
  Philip Pemberton reported the strncasecmp function problem.
  John Duffell reported the service call problem.
Tag:
  CMunge-0_44

------------------------------------------------------------------------
    Version 0.43 00:15:56 28/6/2003
------------------------------------------------------------------------
Revision 1.32  2003/06/27 23:16:51  justin
Summary:
  Fix for alignment of 32bit flags word.
Detail:
  * 32bit flags word should be aligned but would not be if commands
    existed. We now align explicitly before writing the flags.
Admin:
  Reported by Stefan Bellon.
Tag:
  CMunge-0_43

------------------------------------------------------------------------
    Version 0.42 19:21:30 28/5/2003
------------------------------------------------------------------------
Revision 1.31  2003/05/28 18:31:59  justin
Summary:
  Added CMHG_VERSION define (531).
  Changed header generation to create Module_VersionNumber.
  Changed header generation to create Module_Help like CMHG.
  Added support for finalisation called after errors in init code.
Detail:
  * We now define CMHG_VERSION to the closest version number that we
    support. It appears that 5.31 matches the feature set of CMunge rather
    nicely - it's not a perfect match, but it's pretty close. Significant
    differences are in the 32bit code generation and since we don't care
    about the code format in the header, this is not significant.
  * Previously we used Module_VersionNumber as the define for the version
    number of the module. This both clashes with headers created by my
    commit script (local issue) and doesn't match with the use with CMHG.
    I've aligned the use with that of CMHG but this will probably cause
    compatibility issues with earlier CMunge versions. CMHG is the
    definitive version, so we were in the wrong and are now falling in
    line.
  * Similar to the Module_VersionNumber define explained above,
    Module_Help was in previous CMunge versions given as the full help
    string. CMHG only gives the text part at the beginning. We now follow
    CMHG behaviour.
  * When an error is returned from the main module entry point, previous
    versions would fail to call the finalisation for the C library and
    would therefore end up without any form of atexit handling. This could
    also cause problems if any addition RTSK chunks had allocated memory.
    This change is a feedback from a known issue with CMHG which was
    addressed prior to 5.31 (and thus allows us to claim 5.31
    compatibility as described above).
Admin:
  Tested locally with a few example modules and appears to construct
  functioning modules and headers. Will be tested with a range of modules
  over the next couple of weeks.
Tag:
  CMunge-0_42

------------------------------------------------------------------------
    Version 0.41 02:02:25 12/4/2003
------------------------------------------------------------------------
Revision 1.30  2003/04/12 01:04:27  justin
Summary:
  Changed default built to use StubsG.
  Updated 32bit build options to now be non-experimental.
Detail:
  * In order to be as useful as possible, we now link against StubsG
    allowing CMunge to be used 'anywhere'.
  * 32bit build options are still described in the manual as being
    thrown together, but are no longer experimental. Tests have shown
    it to be pretty reliable in generating fully functional modules.
Admin:
  Tested locally with various test files and appears to work correctly.
Tag:
  CMunge-0_41

------------------------------------------------------------------------
    Version 0.40 15:38:13 4/2/2003
------------------------------------------------------------------------
Revision 1.29  2003/02/04 15:46:10  justin
Summary:
  Initial changes for 32bit header generation.
  Added support for -blank generation when in -cmhg mode.
Detail:
  * Tentative work on creating 32bit header code. This should impact
    little on the 32bit header generation as the code is explicitly
    switched away from for 32bit specific changes. The work is based on
    the output from CMHG by examination and should be reasonably simple
    to work into a more sane format.
  * Previously -blank in -cmhg mode would just generate a warning and
    produce a blank CMunge example. This has been changed so that the
    example generated is suitable for CMHG. The warning is still
    generated, because the -blank command is a new CMunge feature.
Admin:
  Tested on the 32bit generation has involved inclusion and removal of
  each of the veneers which the code uses, generation with cmhg and then
  comparing the output. Where possible the forms have been retained to
  ensure that the output is correct. In cases where CMHG generates
  incorrect code, these have been corrected in CMunge. The only known
  cases of these are a backward branch (may have been fixed by a later
  CMHG) and module entry (which seems to enter through the initialise
  point, rather than the entry point).
  Warning: This version is experimental and is flagged as such when
  it starts up.
Tag:
  CMunge-0_40

------------------------------------------------------------------------
    Version 0.39 17:12:11 20/12/2002
------------------------------------------------------------------------
Revision 1.28  2002/12/20 17:14:58  justin
Summary:
  Added support for error block generation.
Detail:
  * -zerrors will generate a AOF file containing just error blocks. This
    is useful for occasions when error blocks are required by a library
    but you do not wish to include an assembler component to the library.
Admin:
  Tested locally with and required for the WebImage libraries.
  I expect that this will be extended in the future to allow generation
  of application veneers in a similar manner to module veneers. These
  are of only specialised interest so probably less useful. If you really
  need such integration in an application you should probably be using a
  DLL instead.
Tag:
  CMunge-0_39

------------------------------------------------------------------------
    Version 0.38 12:56:11 20/12/2002
------------------------------------------------------------------------
Revision 1.27  2002/12/20 12:57:58  justin
Summary:
  Updates for building with OSLib and using 32bit tools.
Detail:
  * OSLib includes were broken; they included os.h rather than oslib/os.h
    which was apparently necessary for later OSLibs.
  * Building with the 32bit tools which default to a different compilation
    mode was not possible with CMunge.
Admin:
  Tested using the examples and a couple of test modules.
  Patches submitted by John Tytgat.
Tag:
  CMunge-0_38

------------------------------------------------------------------------
    Version 0.37 19:51:34 28/7/2002
------------------------------------------------------------------------
Revision 1.26  2002/07/28 18:56:29  justin
Summary:
  Fix for error identifiers with no base.
  Fix for service entry where no service number specified.
Detail:
  * Where error identifiers had been specified, but no base provided, no
    header entry would be generated for those identifiers. This was
    because the error base was being incorrectly used as an identifier of
    errors being present.
  * CMunge would fail to generate a valid fast entry sequence where no
    service numbers were in use. Such modules would not load on RISC OS
    4 where the service table is explicitly checked. We now omit the
    service entry where no service numbers are provided.
Admin:
  Tested locally and seems to work correctly for the module that
  was having problems.
Tag:
  CMunge-0_37

------------------------------------------------------------------------
    Version 0.36 19:16:43 28/7/2002
------------------------------------------------------------------------
Revision 1.25  2002/07/28 18:19:13  justin
Summary:
  Added support for 'carry-capable' generic veneers.
Detail:
  * Carry capable generic veneers are used to return with the 'C' flag set
    from a handler. This has been implemented as a variant of the generic
    veneer, allowing a few interfaces which would previously only have
    been possible using assembler veneers to be used.
Admin:
  Tested locally with example scripts and appears to generate the correct
  code and headers.
Tag:
  CMunge-0_36

------------------------------------------------------------------------
    Version 0.35 13:31:30 27/6/2002
------------------------------------------------------------------------
Revision 1.24  2002/06/27 12:33:11  justin
Summary:
  Fix for vectortrap_f typedef appearing too late.
Detail:
  * The typedef for vectortrap_f was being defined after it was used. This
    made compilation with such headers fail. We now write this definition
    before the uses.
Admin:
  Tested locally and appears to work correctly with the test. Not tested
  in any live code.
Tag:
  CMunge-0_35

------------------------------------------------------------------------
    Version 0.34 16:30:50 24/6/2002
------------------------------------------------------------------------
Revision 1.23  2002/06/24 15:32:25  justin
Summary:
  Fix for -xhdr generation not writing SWIs.
Detail:
  * -xhdr would not write any SWI definitions if no SWI handler was
    supplied (such as happens if all the SWIs are handled by their own
    dedicated functions). We now check for this condition and write out
    the SWIs if either is set.
Admin:
  Tested locally and seems to work correctly now.
  Previously, this fault had been corrected, but only for the C headers.
Tag:
  CMunge-0_34

------------------------------------------------------------------------
    Version 0.33 19:38:03 3/5/2002
------------------------------------------------------------------------
Revision 1.22  2002/05/03 18:40:00  justin
Summary:
  Fix for Help string translation bug.
Detail:
  * When help strings are parsed, they should have underscore replaced by
    a space character. We were not, and this was a deviance from the CMHG
    implementation. We now translate this character on the output in the
    assembler. The header still ends up with underscores. This may or may
    not be an issue.
Admin:
  Tested locally with example header and appears to function as CMHG
  (examples.cmhg.module).
Tag:
  CMunge-0_33

------------------------------------------------------------------------
    Version 0.32 19:58:45 22/4/2002
------------------------------------------------------------------------
Revision 1.21  2002/04/22 19:01:12  justin
Summary:
  Moved help routines to using format_wrap.
  Fix for duplicate entries not being appended to handlers.
Detail:
  * The help code which printed out the options now uses the generic
    wrapping routines to wrap text, rather than being hardcoded. This
    should make maintenance of the text a little easier.
  * Duplicated entries (eg irq_handlers on multiple lines, rather than
    appended to the first line) would replace the preceding entries; this
    caused problems with things that relied on this CMHG behaviour. We
    now support this format.
Admin:
  Tested locally with a component requiring such behaviour.
Tag:
  CMunge-0_32

------------------------------------------------------------------------
    Version 0.31 02:59:17 3/4/2002
------------------------------------------------------------------------
Revision 1.20  2002/04/03 02:06:39  justin
Summary:
  Comments are now generated by central routines.
  Blank file generation now uses the new formatting code.
  Reorganised text formatting functions.
  Added details of private-word to the blank comments.
Detail:
  * New file comments has been created that contains two simple veneers
    to the formatting routines for writing out standard format comments.
    These are very simple and will ensure that the comments come out
    in a similar format whereever they are used.
  * The blank file generation has been converted to use the formatting
    routines, rather than using its own local copy of a similar routine.
    This ensures that the text strings we use are the same throughout
    the code.
  * The text formatting functions have been moved to c.format to allow
    them to be used from elsewhere. These functions are used by the
    writefile, comments and blank files to format their comments, etc.
    The functions have been extended to support the use of the '\b'
    command which will line up all similar \b commands in the subsequent
    lines.
  * Updated the blank comments to include details about the private-word
    parameter.
Admin:
  Tested with example files; needs testing on 'real world' modules.
  The header seems to be generating whitespace oddly. This needs looking
  at, but it's not serious.
Tag:
  CMunge-0_31

------------------------------------------------------------------------
    Version 0.30 22:39:57 29/3/2002
------------------------------------------------------------------------
Revision 1.19  2002/03/29 22:52:31  justin
Summary:
  Updated writeheader.c massively.
Detail:
  * writeheader.c has been reworked to use a set of prototype descriptors
    to describe the comments and function prototypes being defined. The
    changes revolve around having a single routine to output comments and
    prototypes, rather than each section writing out the data itself. This
    allows the header to be customised for a particular style of comments,
    should this be necessary, and more importantly, ensures that the style
    is maintained throughout the source file.
    Primarily this means I can have a nicer format of the comment than
    the classic style.
  * The formatting of comments is handled centrally by header_format which
    will rewrite strings supplied formatted to LINELEN. This is used by
    most of the functions, as well as the prototype_write routine itself.
  * prototype_write is used to write out prototype declaration which is
    of a standard style, with nice readable comments.
Admin:
  Tested with all the modules I have and a load of others; sent to JD and
  Robin and seems to be stable for the present. In theory it should be
  functionally identical to the previous versions. The experiments and
  examinations so far seem to hold this to be true.
  It's possible that there might be some form of 'skinnable' interface
  but that may be slightly extravagant.
Tag:
  CMunge-0_30

------------------------------------------------------------------------
    Version 0.29 02:32:09 29/3/2002
------------------------------------------------------------------------
Revision 1.18  2002/03/29 02:38:17  justin
Summary:
  Added support for private word registers in generic-veneers.
  Fixed problem with header writing out vector-trap header.
Detail:
  * private-word can be used to identify the register containing the
    private word, allowing other registers to be used as a private word
    in the veneers.
  * Vector trap header would be erroneously written out to the header
    because of a missing 'break' statement.
Admin:
  Tested locally by examination. Code looks good in assembler.
Tag:
  CMunge-0_29

------------------------------------------------------------------------
    Version 0.28 04:02:47 9/1/2002
------------------------------------------------------------------------
Revision 1.17  2002/01/09 04:11:43  justin
Summary:
  Fix for C header veneer entry point symbol name using a pointer.
Detail:
  * Symbol name for veneer entry points was given as
       void *func(void);
    which was different to the cmhg version; cmhg uses
       void func(void);
    We now use the same as CMHG.
Admin:
  This failure was causing a previously CMHG based component to fail
  to build. This is unacceptable and the change to conform with CMHG
  behaviour has been made.
Tag:
  CMunge-0_28

------------------------------------------------------------------------
    Version 0.27 12:14:40 24/9/2001
------------------------------------------------------------------------
Revision 1.16  2001/09/24 11:16:31  justin
Summary:
  Correction for vector trap bug in header generation.
Detail:
  * The vectortrap define/typedef were being added for all the handler
    types, rather than just the vectortrap. This caused errors if you used
    two types of veneer routines. Now we only output it where the
    vectortrap is actually used.
Admin:
  Tested locally and seems to work.
  Special reasons on veneer handlers still don't work well; need to look
  at that next.
Tag:
  CMunge-0_27

------------------------------------------------------------------------
    Version 0.26 23:03:49 10/9/2001
------------------------------------------------------------------------
Revision 1.15  2001/09/10 22:10:40  justin
Summary:
  Fix for date getting spaces at the end.
Detail:
  * If a definition were made for the use in the Date string, a space is
    left after the value defined when substituted and this resulted in the
    date string being something like (10 Sep 2001 )
Admin:
  Tested very briefly with an example file.
Tag:
  CMunge-0_26

------------------------------------------------------------------------
    Version 0.25 20:19:09 28/7/2001
------------------------------------------------------------------------
Revision 1.14  2001/07/28 19:22:30  justin
Summary:
  Removed duplicate checks from veneer routines.
  Removed brackets from Module_Version in header.
Detail:
  * generic-veneers and irq-handlers had checks to see that they weren't
    duplicated. If we do this then we're giving a different operation than
    that expected by CMHG, so I've relaxed this restriction.
  * Module_Version conflicts with that given in VersionNum files if we
    use brackets, so I've removed them.
Admin:
  Builds. Tested with test suite.
Tag:
  CMunge-0_25

------------------------------------------------------------------------
    Version 0.24 00:52:09 14/7/2001
------------------------------------------------------------------------
Revision 1.13  2001/07/13 23:53:04  justin
Summary:
  Added export of __module_header.
Detail:
  * __module_header is exported by CMHG, and not by CMunge, so I've added
    it. This allows me to build a module that relies on it existing.
Admin:
  Tested with module which requires it to exist and seemed to work.
Tag:
  CMunge-0_24

------------------------------------------------------------------------
    Version 0.23 14:45:21 23/6/2001
------------------------------------------------------------------------
Revision 1.12  2001/06/23 13:47:34  justin
Summary:
  Fix for broken copyright string comment.
Detail:
  * In updating the copyright string, I removed an end comment, rendering
    the header files invalid.
Admin:
  Tested with examples and works.
Tag:
  CMunge-0_23 (retagged)

Revision 1.11  2001/06/23 11:52:38  justin
Summary:
  Fix for -xh not exporting SWIs where handler omitted.
  Added copyright file.
Detail:
  * -xh was only checking if there was a swi_handler present, rather than
    checking whether a SWI handler was in use (swi_codeprovided could be
    set). Now fixed.
  * Copyright header file describes who CMunge is copyrighted by, so that
    we don't have the same string scattered about the source.
Admin:
  Fix should ensure that InetServices can export a SWIs header (tested
  with it and seems to work)
Tag:
  CMunge-0_23

------------------------------------------------------------------------
    Version 0.22 20:17:29 15/5/2001
------------------------------------------------------------------------
Revision 1.10  2001/05/15 19:18:41  justin
Summary:
  Fix for swi_names block being allocated too small entries
Detail:
  * The entries were allocated as a pointer, rather than as a structure,
    which could cause corruption of random data and crashes.
Admin:
  Fix supplied by Alex Thoukydides.
Tag:
  CMunge-0_22

------------------------------------------------------------------------
    Version 0.21 23:59:59 6/5/2001
------------------------------------------------------------------------
Revision 1.9  2001/05/06 23:02:28  justin
Summary:
  Fix for bug in DateStamp that allocated too little memory.
Detail:
  * DateStamp was being given too little space when allocating room for
    it on the end of the help string.
Admin:
  This fixes Peter Naulls problems with particular lengths of help text
  extensions and an explicit date string.
Tag:
  CMunge-0_21

------------------------------------------------------------------------
    Version 0.20 12:11:30 20/4/2001
------------------------------------------------------------------------
Revision 1.8  2001/04/20 11:15:30  justin
Summary:
  Fix for overload strings leaving trailing quotes open.
Detail:
  * Patch sent by Alex Thoukydides to fix problem with writing command and
    help strings in objasm-friendly format. Previously, it could be
    possible to leave a quote open at the end of a line.
  * Alex has restructured the code to remove the old return replacement
    version, and amalgamate the code into a single routine (much nicer).
  * Also, I fixed a minor bug introduced which failed to write out escaped
    quotes as literal quotes. This is now fixed.
Admin:
  Tested with the examples, and with the test that Alex sent; works
  correctly and produces lines of equal length (or slightly longer, due
  to the way that numeric values are written out - this is not a problem
  as we are very conservative with our line length restrictions).
Tag:
  CMunge-0_20

------------------------------------------------------------------------
    Version 0.19 23:52:33 18/2/2001
------------------------------------------------------------------------
Revision 1.7  2001/03/19 00:09:35  justin
Summary:
  Added notes about 32bit support.
  Added 'vector-traps' support.
  A few routine names re-named.
Detail:
  * 32bit support isn't implemented just yet, but we've got the place
    holders in place. Basically we have bitness which can be bitness_32 or
    bitness_26. If it's 32, we abort with a fatal error at present.
  * vector-traps are my very simple implementation of post processing
    vectors in C. This isn't actually all that complex, but requires a
    little bit of care. We call a routine, the trap routine, that passes
    on all the calls to the rest of the chain and then returns.
  * library-init-code is not library-enter code. There are a few similar
    changes to fit in with cmhg.
Admin:
  Tested the vector-traps with some test code and it appears to work
  properly.
  Tested the -26bit and -32bit and the work (or exit) as appropriate.
Tag:
  CMunge-0_19

------------------------------------------------------------------------
    Version 0.18 21:48:54 18/1/2001
------------------------------------------------------------------------
Revision 1.6  2001/02/18 21:51:15  justin
Summary:
  Fixed help message for -xhdr and -xh options.
Detail:
  * Previous versions of CMunge used to use -hdr to create a header file.
    This has been updated to -xhdr and -xh (assembler and C respectively)
    so that there can be more future expansion. However, in the last
    version, this was not reflected in the help message.
Admin:
  Purely a change to the help message.

------------------------------------------------------------------------
    Version 0.17 23:06:40 2/1/2001
------------------------------------------------------------------------
Revision 1.5  2001/02/02 23:08:42  justin
Summary:
  Further minor changes to makefile for building.
Detail:
  * "When performing global search and replace, check the results, they
    may not be as you wish" Problems with the global replace of Release
    with $(RELEASE) meant that the zipping of files failed, as did the
    actual release itself :-(
Admin:
  Does now build; required release for Jonathan Cooper who reported a
  bug that is apparently fixed.

Revision 1.4  2001/02/02 21:00:14  justin
Summary:
  Fix for omitted !Mk* scripts.
Detail:
  * In the update, these scripts were removed and had not been updated.
    The scripts are not visible on release versions.
Admin:
  Build change should not affect external release version. Internal
  version will now build :-)

Revision 1.3  2001/02/02 20:57:29  justin
Summary:
  Update of build structure.
Detail:
  * The 'build' system used here has been updated to include Export and
    Release phases. This allows a more standardised build system, with
    much greater control over how components are built and the automatic
    building of components which are required without the requirement for
    complex interdependent makefiles. The changes in the way in which
    CMunge is built do not affect the external release version as they are
    transparent in use.
Admin:
  Should be no noticeable change in the CMunge being built.

Revision 1.2  2000/12/05 00:49:01  justin
Summary:
  Initial checkin of CMunge.
Detail:
  * In theory, this version should be able to regenerate itself.
Admin:
  Local tests created working versions and regenerated the tests.
  Peter Naulls has briefly tested this version prior to this checkin and
  worked.

------------------------------------------------------------------------
    Version 0.16 00:39:57 5/11/2000
------------------------------------------------------------------------
Revision 1.1  2000/12/05 00:25:37  justin
Version files now : VersionNum VersionLog

=============================================================================
History up to CVS check in point
=============================================================================

v0.17  05 Dec 2000 (JRF)
  Checked into CVS.
  Now able to create automated logs from CVS entries.

v0.16  24 Sep 2000-31 Oct 2000 (JRF)
  Added fixes from Theo Markettos (just applied diffs really) -
    error-chunk-base-number can now be at any alignment, to allow for very
      compact error number use.
    SWI bases cannot have the x-bit set.
    Experimental (/really/ experimental) simple-app support. Really only use
      this if you're 100% sure you know what you're doing.
    Whitespace skipping added to start of lines.


v0.15  10 May 2000 (JRF)
  
  Added fixes for Alex Thoukydides' bugs -
    Long lines in ObjAsm (this had been mentioned by John Tytgat previously)
    Command parameter arguments (commas in rogue positions could have a
      bad effect previously)


v0.14  06 Feb 2000 (JRF)
  
  Added _blib_entermodule support for obsolete CMHG files (eg ShareFS).
  Added support for module-is-not-re-entrant.
  Fixed error handler for cases where final \n not output.
  Added generalised file handling code for coping with files which are
    otherwise left lying around on failure. No files should be retained
    in scrap, or partially written when cmunge fails.
  Internationalised message files now work.

 
v0.13  07 Jan 2000 (JRF)

  Unknown fields will now be reported correctly, rather than by 'programmer
    confusion error' which is intentionally unhelpful.
  Added command 'handlers' in a similar manner to SWI handlers. These are
    specified using the 'handler:' token.
  Fixed throwback when reporting errors in CLI arguments.
  Added '# <line> "<file>"' syntax for GCC style pre-processing, when I get
    around to it.
  Updated (C) string on all files.
  Added -cmhg so that we now have a means of preventing our creating CMunge
    only files if we so desire.
  Fixed bug with generic handlers which output them as functions returning
    ints, not _kernel_oserror *'s.
  Corrected a bug in veneer functions that got the address of the handler
    routine wrong (miswrote the header).
  Fixed bug in assembler header generated X-SWI variants.


v0.12  28 Dec 1999 (JRF)

  Added 'special' SWI handlers. It's now possible to dispatch SWIs without
    a switch in your C code.
  CMUNGE_VERSION is now defined as an integer number, rather than the decimal
    value it was on earlier versions.
  Added fallback to as if objasm gives an error.
  Updated documentation slightly.
  Fixed alignment after Bad_SWI error name (identified by as)
  Removed capitalised registers from generated source (as doesn't like them)
  Added support for building a release.


v0.11  23 Dec 1999 (JRF)

  Added error-identifiers, together with horrid casting to make this work.
  Corrected handling of swi_base so that it reports mismatched swi_base/
    table/etc usage in the right place (was doing it prior to reading the
    file).


v0.10  21 Dec 1999 (JRF)
  
  Added error-chunk-base-number to declare ERROR_BASE in C header file.
  Added assembler header file for to declare SWIs exported.
  SWI numbers are now output 'lined up' in the header file.
  cmhg <infile> -d <file> now works (used to complain about no output)
  Throwback now works with errors from CMunge itself
  Field parser is now much more generic and so new fields can be added
    more easily (no more copying chunks of code wrongly as I tended to :-( )
  Files which are #included but contain nothing now work (previously passed
    preprocessor directives through to parse_line)
  Header files generation code is now through continuation lines where
    possible. I'm not sure Robin will like that, but it makes things clearer
    to me because things line up better. And the code produced is better
    because only one function is called. Ok, so I'm justifying something odd
    now!
  Makefile updated to automatically build the examples with 'make examples'
  Documentation updated to reflect some of the new features.
  Now defines <SWI Prefix>_00 as the base of the SWIs to match CMHG operation.
  
  Faults identified:
   * If an error occurs whilst processing the preprocessor file, we can't
     remove it because it is open.
   * Need to check if the user specified 00 as a SWI name as this will give
     an error in the C header.


v0.09  02/11/99

  Fixed SWI headers not being generated correctly. Thanks to P.Naulls.


v0.08  16/10/99

  Fixed more bugs reported by John Tytgat
   * Initialisation code had r10 instead of r0. Doh!
   * Handlers *must* be defined as void XXX(void), not extern void *XXX;
     due to Module C code offsetting data pointers within a block. Drat.


v0.07  11/10/99

  Fixed more bugs reported by John Tytgat.
   * Service call handler returned void *, not void.
   * OSLib option was broken.

  Updated manual slightly.
  
  Corrected the error reporting introduced in v0.06 (reported by Andreas
  Walter).
  
  Added 'date-string' (more CMHG undocumentedness) dug up by Peter Naulls.
 
 
v0.06  9/10/99

  Fixed bugs reported by Andreas Walter:
    * No finalisation code forgot to IMPORT _clib_finalise_module.
    * No command table still included a reference to a non-existent command
      table
    * No title string was not flagged as an error.
    * No help string was not flagged as an error.
    * \r's in input file were not parsed correctly.

  Added -zbase option (to define Image__RO_Base in the generated header).

v0.05  06/10/99

  Added Internationalisation.

  Added add-syntax.

  Fixed parser bugs (wrt to non-concatenated strings at end of lines).
  
  Fixed predefine handling (under-mallocing).
  
  Added undefine handling.
  
  Added Include path handling.
  
  First stab at -depend, but not happy with it (so undocumented) (except here
    obviously).


v0.04  05/10/99

  Incorporated changes from J.Tytgat:
    * Removed double #include in header
    * Added -zoslib option, and updated header generation to match.
    * Corrected service handler to have void return type.
    * Corrected return type of representable to unsigned int.
    * Fixed non-big service entry.

  Put constants &21c back into assembler output. If anyone can figure out how
  to successfully use _L1ib$Reloc$Off instead, then please, please tell me!
  
  Corrected call to _clib_initialise to be _clib_initialisemodule


v0.03: 03/10/99

  Fixed bug in number parsing (reported by J Tytgat).


v0.02: 26/9/99

  Assembler generated uses stubs relocation constants and not &21C.
  
  Now copes with no service calls being defined.

  Changes to generated header file:  
    * error_BAD_SWI defined.
    * Entry point to handlers now declared to be void *. Still not the same as
      CMHG's void entry(void), but safer; people shouldn't be tempted to call
      it!
    * extern and consts to some of the prototypes.
    * file wrapped in if __cplusplus
    * COMMAND_ changed to CMD_
    * Now doesn't include <stdio.h>
    * CMUNGE_VERSION defined
    * Macros for text definitions (date, version, title, help string etc).
    * Comments in header file now clearer.

  Now copes with both 1 and 2 functions being given with swi-decoding-code:.

  Fixed bug in service handler.
  
  Now parses numbers in the 0x form correctly, and copes with numbers in
    parentheses.


v0.01: 23/9/99

  First Beta release
